package com.study_online.service.Impl;/*
    张昊（java文件）
 
*/

import com.study_online.domain.ResultInfo;
import com.study_online.domain.Video;
import com.study_online.domain.VideoType;
import com.study_online.mapper.VideoTypeMapper;
import com.study_online.service.VideoTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VideoTypeServiceImpl implements VideoTypeService {

    @Autowired
    private VideoTypeMapper videoTypeMapper;

    //查询所有分类下的所有视频
    @Override
    public ResultInfo findId(int id) {
        ResultInfo info=new ResultInfo();
        info.setFlag(true);
        try {
            List<Video> all = videoTypeMapper.findId(id);
            info.setData(all);

        }catch (Exception e){
            info.setFlag(false);
            info.setErrorInfo("查询失败");
            e.printStackTrace();
        }

        return info;
    }
}
